package cmo.neutech.day13.dome1;

import cmo.neutech.day13.dome1.Ball;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Scanner;

public class TextHashSet {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        HashSet<Integer> set1 = new HashSet<>();
        HashSet<Integer> set2 = new HashSet<>();
        Random random = new Random();
        Ball ball1 = new Ball();
        Ball ball2 = new Ball();
        int t = 0;
        int ball1Bull = scanner.nextInt();
        int ball2Bull = ball2.BullBall(random.nextInt(6)+1);
        if(ball1Bull == ball2Bull){
            t++;
        }
        for (int i = 0; i < 6; i++) {
            set1.add(scanner.nextInt());
            set2.add(random.nextInt(33)+1);
        }
        Iterator<Integer> i1 = set1.iterator();
        Iterator<Integer> i2 = set2.iterator();
        while(i1.hasNext()){
            while(i2.hasNext()){
                if(i1.next() == i2.next()){
                    t++;
                }
            }
        }
            System.out.println(set1);
            System.out.println(ball1Bull);
            System.out.println(set2);
            System.out.println(ball2Bull);
            System.out.println("猜对"+t+"个球");
    }
}
